<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <link rel="stylesheet" href="./css/reset.css">
  <link rel="stylesheet" href="./css/adm.css">
  <style type="text/css">
    h1 a:link {
      color: black;
    }

    h1 a:visited {
      color: black;
    }
  </style>
</head>

<body>
  <header>
    <h1><a href="index.php">Blog后台管理界面</a></h1>
  </header>
  <div id="main">
    <div id="lside">
      <aside>
        <h4>栏目管理</h4>
        <ul>
          <li><a href="catlist.php">栏目列表</a></li>
          <li><a href="catadd.php">添加栏目</a></li>
        </ul>
      </aside>
      <aside>
        <h4>文章管理</h4>
        <ul>
          <li><a href="artlist.php">文章列表</a></li>
          <li><a href="artadd.php">发布文章</a></li>
        </ul>
      </aside>
      <aside>
        <h4>个人中心</h4>
        <ul>
          <li><a href="">修改密码</a></li>
          <li><a href="info.php">退出登陆</a></li>
        </ul>
      </aside>
    </div>
    <div id="rside">
      <table>
        <tr>
          <td>文章序号</td>
          <td>发布时间</td>
          <td>标题</td>
          <td>栏目名称</td>
          <td>评论</td>
          <td>操作</td>


        </tr>
        <!--$v 如果只写一个，只循环值-->
        <!-- <?php foreach ($data as $k => $v) {?>
        <tr>
          <td style="width: 65px;"><?php echo $v['art_id'];?></td>
          <td style="width: 65px;"><?php echo $v['cat_id'];?></td>
          <td style="width: 60px;"><?php echo $v['user_id'];?></td>
          <td style="width: 60px;"><?php echo $v['nick'];?></td>
          <td><?php echo $v['title'];?></td>
          <td><a href="#"><?php echo $v['content'];?></a></td>
          <td style="width: 60px;"><?php echo $v['pubtime'];?></td>
          <td style="width: 60px;"><?php echo $v['lastup'];?></td>
          <td style="width: 60px;"><?php echo $v['comm'];?></td>
          <td><a
              href="artedit.php?id=<?=$v['art_id'];?>&cid=<?=$v['cat_id'];?>">编&nbsp;辑</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
              href="artdel.php?id=<?=$v['art_id'];?>">删&nbsp;除</a></td>
        </tr>
        <?php }?> -->

        <?php foreach($data as $k => $v){?>
        <tr>
          <td>
            <?php echo $v['art_id'];?>
          </td>
          <td>
            <?php echo date('Y-m-d', $v['pubtime']) ;?>
          </td>
          <td><a href="#">
              <?php echo $v['title'];?>
            </a></td>
          <td>
            <?php echo $v['catname'];?>
          </td>
          <td><span class="badge">
              <?php echo $v['comm'];?>
            </span></td>
          <td><a
              href="artedit.php?id=<?=$v['art_id'];?>&cid=<?=$v['cat_id'];?>">编&nbsp;辑</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
              href="artdel.php?id=<?=$v['art_id'];?>">删&nbsp;除</a></td>
        </tr>
        <?php }?>
        <!-- 
        <tr>
          <td>3</td>
          <td>2013/12/03</td>
          <td><a href="#">这是2013年的第一场雪</a></td>
          <td>心情随笔</td>
          <td><span class="badge">9</span></td>
          <td>已发布</td>
        </tr> -->
      </table>
      <div id="pagebar">
        Pages:&nbsp;
        <?php foreach($pages as $k => $v){?>
        <?php if($k == $curr){?>
        <!--1=>'page=1'-->
        <?php echo $k; }else{?>
        <a href="artlist.php?<?php echo $v;?>">
          <?php echo $k;?>
        </a>
        <?php }?>

        <!-- <a href="#">2</a>
        <a href="#">3</a>
        4
        <a href="#">5</a>
        <a href="#">6</a> -->
        <?php }?>
      </div>
    </div>
  </div>
  <footer>
    Copyright &copy; 2020 · GeneratePress · WordPress
  </footer>
</body>

</html>